﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class ShopNpc:Npc
    {
        private string item;
        private string name;
        public string Item { get => item; set => item = value; }
        public override void Speak()
        {
            Console.WriteLine("NPC：{0}，我这里有{1}商品，你要吗？", base.Name, this.item);//this 我的   base 爸爸的
            //什么情况下，base和this是不一样的。base.age this.age
        }

        public ShopNpc(string name, NPCType type, string item) : base(name, type)
        {
            this.item = item;
        }
    }
}
